package br.ufal.tci.nexos.arcolive;

import br.ufal.tci.nexos.arcolive.descriptors.ProtocolDescriptor;

public class ArCoLIVEService {

	private int serviceId;
	private String name;
	private String description;
	private int maxInstances;
	private ProtocolDescriptor protocolDescriptor = null;
	
	public ArCoLIVEService(int serviceId) {
		this.serviceId = serviceId;
	}
	
	public ArCoLIVEService(int serviceId, String protocolClasspath) {
		this.serviceId = serviceId;
		this.protocolDescriptor = new ProtocolDescriptor(protocolClasspath);
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getMaxInstances() {
		return maxInstances;
	}

	public void setMaxInstances(int maxInstances) {
		this.maxInstances = maxInstances;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getServiceId() {
		return serviceId;
	}

	public int hashCode() {
		return this.serviceId;
	}
	
	public boolean equals(Object object) {
		if (object instanceof ArCoLIVEService) {
			return (this.serviceId == ((ArCoLIVEService) object).getServiceId());
		}
		return false;
	}

	public ProtocolDescriptor getProtocolDescriptor() {
		return protocolDescriptor;
	}
	
}
